package com.example.demo.controller;

import com.example.demo.service.impl.EChartsServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class EChartsController {

    @Autowired
    private EChartsServiceImpl eChartsService;

    @GetMapping("/findValueByYear/{year}/{place}")
    public Double[] findValueByYear(@PathVariable Integer year,@PathVariable String place) {
        Double[] valueByYear = eChartsService.findValueByYear(year,place);
        return valueByYear;
    }

    @GetMapping("/plusValueByYear/{year}/{place}")
    public Double[] plusValueByYear(@PathVariable Integer year,@PathVariable String place) {
        Double[] plusValueByYear = eChartsService.plusValueByYear(year,place);
        return plusValueByYear;
    }

}
